package com.lin.cms.domain;

import java.io.Serializable;

public class Upload implements Serializable {

	private static final long serialVersionUID = 1L;

	private String filename;

	private int length;

	private long lastModified;

	private byte[] content;;

	public Upload() {
	}
	
	public Upload (
			java.lang.String filename,
			java.lang.Integer length,
			java.lang.Long lastModified,
			byte[] content) {
		this.filename=filename;
		this.length=length;
		this.lastModified=lastModified;
		this.content=content;

		}

	public String getFilename() {
		return filename;
	}

	public void setFilename(String filename) {
		this.filename = filename;
	}

	public int getLength() {
		return length;
	}

	public void setLength(int length) {
		this.length = length;
	}

	public long getLastModified() {
		return lastModified;
	}

	public void setLastModified(long lastModified) {
		this.lastModified = lastModified;
	}
	
	public byte[] getContent() {
		return content;
	}

	public void setContent(byte[] content) {
		this.content = content;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((filename == null) ? 0 : filename.hashCode());

		return result;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final Upload other = (Upload) obj;
		if (filename == null) {
			if (other.filename != null)
				return false;
		} else if (!filename.equals(other.filename))
			return false;

		return true;
	}
	
	@Override
	public String toString() {
		return getClass().getName() + "@" + Integer.toHexString(hashCode()) + 
			"(" + 
			"filename=" + "'" + filename + "'" + 
			")";
	}
	
}
